package Questions;

import java.util.ArrayList;


/**
 * Created by:
 * User: Igor Martynovich and Guzenko Igor
 * Date: 25.11.13
 */
public class QuestionsFactory {

    public Question getQuestion(String question, String rightAnswer, ArrayList<String> variantsList) {
        Question newQuestion;
        if (variantsList.isEmpty()) {
            newQuestion = new AnswerQuestion(question, rightAnswer);

        } else {
            String[] variants = variantsList.toArray(new String[variantsList.size()]);
            newQuestion = new TestQuestion(question, rightAnswer, variants);

        }

        return newQuestion;
    }
}
